import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Student from '@/components/back/student/index'
import Teacher from '@/components/back/teacher/index'
import Course from '@/components/back/course/index'
import CourseAdd from '@/components/back/course/add'
import backIndex from '@/components/back/index'
import leftMenu from '@/components/back/leftMenu'
import bread from '@/components/bread'
import parent from '@/components/example/parent'
import FrontStudent from '@/components/front/student/index'


import StudentAdd from '@/components/back/student/add'
import Index from '@/components/front/index'

import Scroll from '@/components/front/index/scroll'

import Login from '@/components/login'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/scroll',
      name: 'Scroll',
      component: Scroll
    },
    //前台
    {
      path: '/student',
      name: 'FrontStudent',
      component: FrontStudent
    },
    {


      //后台
      path: '/bread',
      name: 'bread',
      component: bread,
      children: [
        {
          path: '/backstage/protaManage/turns',
          name:'学生管理',
          component: resolve => require(['@/components/back/student/'], resolve),
          meta: {title: '学生管理'}
        },
        ]
    },
    {
      path: '/leftMenu',
      name: 'leftMenu',
      component: leftMenu
    },
    {
      path: '/parent',
      name: 'parent',
      component: parent
    },
    {
      path: '/back/course/add',
      name: 'CourseAdd',
      component: CourseAdd
    },
    {
      path: '/back/student/add',
      name: 'StudentAdd',
      component: StudentAdd
    },

    {
      path: '/',
      name: 'Index',
      component: Index,
      children: [
        {
          path: '/front/indexParent',
          name:'首页',
          component: resolve => require(['@/components/front/index/indexParent'], resolve),
        },]
    },
    {
      path: '/back',
      name: 'backIndex',
      component: backIndex,
      children: [
        {
          path: '/back/student',
          name:'学生管理',
          component: resolve => require(['@/components/back/student/'], resolve),
          meta: {title: '学生管理'}
        },
        ,
        {
          path: '/back/teacher',
          name:'教师管理',
          component: resolve => require(['@/components/back/teacher/'], resolve),
          meta: {title: '教师管理'}
        },
        {
          path: '/back/course',
          name:'课程管理',
          component: resolve => require(['@/components/back/course/'], resolve),
          meta: {title: '课程管理'}
        }
      ]

    },
    {
      path: '/back/student',
      name: 'Student',
      component: Student
    },
    {
      path: '/back/teacher',
      name: 'Teacher',
      component: Teacher
    },
    {
      path: '/back/course',
      name: 'Course',
      component: Course
    }
  ]
})
